<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue使用之class&style绑定</title>
    <script src="../vue.min.js" type="text/javascript"></script>
    <style>
        .changeColor{
            color: red;
        }
    </style>
</head>
<body>
<div id="app">
    <div v-bind:class="{changeColor: true}">hello 黄小强</div>
    <div v-bind:class="[activeClass]">hello 黄小强</div>

    <div v-bind:style="{color:color}">hello 黄小强</div>
    <div v-bind:style="[styleObj]">hello 黄小强</div>
</div>

<script type="text/javascript">
    var app=new Vue({
        el: '#app',
        data:{
            activeClass: 'changeColor',
            color: 'blue',
            styleObj:{
                color: 'green'
            }
        }
    })
</script>
</body>
</html>